﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="photolist.aspx.vb" Inherits="WSADProject.photolist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
    <div style="text-align: center">
</div></asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div style="text-align: center">
        <asp:Label ID="lbldata" runat="server"></asp:Label>
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="PhotoID" DataSourceID="SqlDataSource1" GroupItemCount="2">
        <AlternatingItemTemplate>
            <td id="Td1" runat="server" style="">
                        
               <%# Eval("Caption") %><br />
               <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl='<%# String.Format("~/{0}", Eval("SmallUrl"))%>' NavigateUrl ='<%# String.Format("~/Photodetail.aspx?PhotoID={0}", Eval("PhotoID"))%>'  ></asp:HyperLink>
             <br />  
                Uploaded <%# Eval("Dateupload", "{0:D}")%> at <%# Eval("Timeupload", "{0:T}")%>
                <br /></td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td id="Td2" runat="server" style="">PhotoID:
                <asp:Label ID="PhotoIDLabel1" runat="server" Text='<%# Eval("PhotoID") %>' />
                <br />SmallUrl:
                <asp:TextBox ID="SmallUrlTextBox" runat="server" Text='<%# Bind("SmallUrl") %>' />
                <br />Dateupload:
                <asp:TextBox ID="DateuploadTextBox" runat="server" Text='<%# Bind("Dateupload") %>' />
                <br />TimeUpload:
                <asp:TextBox ID="TimeUploadTextBox" runat="server" Text='<%# Bind("TimeUpload") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                <br /></td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr>
                    <td>No Photos.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td id="Td3" runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr id="itemPlaceholderContainer" runat="server">
                <td id="itemPlaceholder" runat="server"></td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td id="Td4" runat="server" style="">SmallUrl:
                <asp:TextBox ID="SmallUrlTextBox" runat="server" Text='<%# Bind("SmallUrl") %>' />
                <br />Caption:
                <asp:TextBox ID="CaptionTextBox" runat="server" Text='<%# Bind("Caption") %>' />
                <br />Dateupload:
                <asp:TextBox ID="DateuploadTextBox" runat="server" Text='<%# Bind("Dateupload") %>' />
                <br />TimeUpload:
                <asp:TextBox ID="TimeUploadTextBox" runat="server" Text='<%# Bind("TimeUpload") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                <br /></td>
        </InsertItemTemplate>
        <ItemTemplate>
              <td id="Td1" runat="server" style="">
                  <%# Eval("Caption") %><br />
                 <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl='<%# String.Format("~/{0}", Eval("SmallUrl"))%>' NavigateUrl ='<%# String.Format("~/Photodetail.aspx?PhotoID={0}", Eval("PhotoID"))%>'  ></asp:HyperLink><br />
                Uploaded on <%# Eval("Dateupload", "{0:D}")%> at <%# Eval("Timeupload", "{0:T}")%>
                <br /></td>
        </ItemTemplate>
        <LayoutTemplate>
            <table id="Table2" runat="server">
                <tr id="Tr1" runat="server">
                    <td id="Td5" runat="server">
                        <table id="groupPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr2" runat="server">
                    <td id="Td6" runat="server" style="">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td id="Td7" runat="server" style="">PhotoID:
                <asp:Label ID="PhotoIDLabel" runat="server" Text='<%# Eval("PhotoID") %>' />
                <br />SmallUrl:
                <asp:Label ID="SmallUrlLabel" runat="server" Text='<%# Eval("SmallUrl") %>' />
                <br />Caption:
                <asp:Label ID="CaptionLabel" runat="server" Text='<%# Eval("Caption") %>' />
                <br />Dateupload:
                <asp:Label ID="DateuploadLabel" runat="server" Text='<%# Eval("Dateupload") %>' />
                <br />TimeUpload:
                <asp:Label ID="TimeUploadLabel" runat="server" Text='<%# Eval("TimeUpload") %>' />
                <br /></td>
        </SelectedItemTemplate>
    </asp:ListView>
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT [PhotoID], [SmallUrl], [Caption], [Dateupload], [TimeUpload] FROM [tblPhoto] WHERE ([Actv] ='A') ORDER BY [Dateupload] DESC, [TimeUpload] DESC">
      </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT tblPhoto.PhotoID,tblPhoto.Url, tblPhoto.SmallUrl, tblPhoto.Caption, tblPhoto.Dateupload, tblPhoto.TimeUpload FROM (tblPhoto INNER JOIN tblProfile ON tblPhoto.UserName = tblProfile.UserName) WHERE (tblPhoto.Actv = 'A') AND (tblProfile.UserName = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="?" QueryStringField="UserName" />
            </SelectParameters>
        </asp:SqlDataSource>
      <p>
       <asp:HiddenField ID="hiddenUserName" runat="server" Value="0" />
        <br />
 </div>
</asp:Content>
